package com.github.prontera.controller;

import io.swagger.annotations.ApiOperation;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.github.prontera.ApiVersion;
import com.github.prontera.RequestLogging;
import com.github.prontera.common.filter.IgnoreAuth;
import com.github.prontera.domain.Coterie;
import com.github.prontera.model.response.ObjectDataResponse;
import com.github.prontera.service.CoterieService;
import com.github.prontera.util.Page;


/**
 * 活动
 */
@RestController
@RequestMapping(value = ApiVersion.MANAGE_V1_PREFIX + "/coterie", produces = { MediaType.APPLICATION_JSON_UTF8_VALUE }, consumes = { MediaType.APPLICATION_JSON_UTF8_VALUE })
public class CoterieController{
	
	@Autowired
	private CoterieService coterieService;
	/**
	 * 查询活动列表
	 */
	
	@IgnoreAuth
	@RequestMapping(value = "find", method = RequestMethod.POST)
	@ResponseBody
	@ApiOperation(value = "查询圈子列表" , notes = "查询圈子列表")
	public ObjectDataResponse<Page<Coterie>> find(@RequestBody Coterie coterie){
		
		coterie.setOrderBy("C_COTERIE.create_time desc");
		Page<Coterie> datas =coterieService.page(coterie);
		return new ObjectDataResponse<Page<Coterie>>(datas);
	}
}
